package com.yzc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yzc.Details.SecurityUser;
import com.yzc.model.entity.system.SysUser;
import com.yzc.model.query.system.UserInfoReq;
import com.yzc.model.vo.system.UserInfoVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Yzc
 * @description 针对表【t_user】的数据库操作Mapper
 * @createDate 2024-05-23 14:22:12
 * @Entity com.yzc.pojo.UserBean
 */
@Mapper
public interface UserMapper extends BaseMapper<SysUser> {

    List<UserInfoVo> loadaAll();

    @Select("SELECT id, username,password, beizhu, email, roleid, rolename " +
            " FROM v_userinfo" +
            " WHERE username = #{username} AND is_deleted = 0")
    SecurityUser selectByUsername(String username);

    UserInfoVo getInfoById(Long id);

    Boolean saveUser(UserInfoReq userInfoReq);


    Boolean settingRole(@Param("userid")Long userid,@Param("kzid") Integer kzid);

    Boolean updateUser(UserInfoReq userInfoReq);
}